package top.appx.service.impl;

import org.springframework.stereotype.Service;
import top.appx.dao.FolderDao;
import top.appx.entity.FolderEntity;
import top.appx.service.FolderService;
import top.appx.vo.FolderVO;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by zwy on 2015-6-11.
 */
@Service
public class FolderServiceImpl implements FolderService {
    @Resource
    private FolderDao folderDao;

    public List<FolderVO> queryAll() {
        List<FolderEntity> list = folderDao.queryAll();
        List<FolderVO> voList = new ArrayList<FolderVO>();
        for(FolderEntity f:list){
            voList.add(new FolderVO(f));
        }
        return voList;
    }

    public FolderEntity getById(int id) {
        return folderDao.getById(FolderEntity.class,id);
    }
}
